<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <hdjs/>
</head>
<body>
	<div class='wrap'>
		<div class='title-header'>模板列表</div>
        <!-- 可供选择的模板 -->
        <ul>
            <list from="$dirs" name='$d'>   
            <li <if value="$d.current">class='current'</if> dir='{$d.filename}' > 
                <div>
                    <img src="{$d.image}" alt="模板">
                    <p>{$d.config.author.0}</p>
                    <p>{$d.config.email.0}</p>
                </div>
            </li>
            </list>
        </ul>
	</div>
    <!-- 样式 -->
    <style>
        ul li{
            float:left;
            border:solid 1px #339839;
            margin:10px;
            cursor: pointer;
        }
        ul li.current{
            border:solid 3px #339839;
        }
         ul li.current img{
              opacity: 1;
        }
        ul li img{
            width:200px;
            height:200px;
            opacity: 0.3;
        }
        ul li p{
            padding:6px;
            color:#333;
        }
    </style>
    <!-- js效果 -->
    <script>
        $('ul li').click(function(){
            var dirName=$(this).attr('dir');
            $.post(CONTROLLER+'&a=set',{dir:dirName},function(json){
                    alert(json.message);
                    location.reload(true);
            },'json');
        })
    </script>
</body>
</html>